function messageCenterCtrl($scope, $http) {
  'ngInject';

  this.paginationData = {
    pageNum: 0,
    pageSize: 10,
    total: '',
  }

  this.query = () => {
    let pageNum = this.paginationData.pageNum;
    if (pageNum > 0) {
      pageNum--;
    }
    let queryData = {
      pageNum: pageNum,
      pageSize: 10,
    }
    $http
      .post(`${SERVER_CONTEXT}/api/user/app/message/queryMessageList`, queryData)
      .success((data) => {
        this.paginationData.total = data.total;
        this.msgList = data.data;
        console.log(this.paginationData.total);
      })
  }

  this.readMsg = (item) => {
    $http
      .post(`${SERVER_CONTEXT}/api/user/app/message/updateMessageStatus`, {id: item.id})
      .success((data) => {
        if (data.success) {
          item.isRead = 1;
          $scope.$emit('read-msg');
        }
      })
  }

  this.query();



}

export default messageCenterCtrl;